1. The two data control properties you must set when you link a form to a database are the DatabaseName property and the RecordSource property.
2. Set the Caption property of the data control to display a meaningful name between the record pointer arrows.
3. You must set the DataSource property of the input control to the data table and the DataField property of the input control to the field name in the data table.
4. You only need one line of Visual Basic code (not including the Sub...End Sub statements) to add delete functionality to a data entry form when using the Visual Basic data control. An example of this code is
datTitles.Recordset.Delete ' delete the current record
5. Select either the Save Changes or Prompt to Save Changes option from the Program Starts environmental variable option group. This can be found by selecting the menu option Tools | Options and then selecting the Environment tab. Once one of these choices is selected, you save, or will be prompted to save, your project each time you run it.
Answers to Day 1 Exercises
1. While in design mode, select the form by clicking anywhere on the form that doesn't have a control. Press F4 and select the Caption property. Type "The Titles Program" and press Enter. Note that the title appears on the title bar of the form as you type.
2. Complete the following steps to build an Exit button:
· Double-click the Command Button control on the Visual Basic toolbox to add a new button to the form.
· Set the Name property to cmdExit for the new button.
· Drag the new button to align it with the Add and Delete buttons.
· Set the Caption property to E&xit.
· Enter the following code in the cmdExit_Click procedure: